<?php 

include '../../function.php';
// 判断是否post
if($_POST){
	$db = include './db.php';

	array_push($db, $_POST);

	$newDb = var_export($db,TRUE);

	$newDb = "<?php return $newDb ?>";

	file_put_contents('./db.php', $newDb);

	$message = "留言成功";

	include './tpl/success.html';


}else{
	// 非POST,跳转回首页
	// 引入错误页面
	$error = "留言失败";
 	include './tpl/error.html';
}


 ?>